

clear
set more off


cap log close
log using $logdir/analysis/late_filers.log, replace


clear
set odbcmgr REDACTED

odbc list
#delimit ;

odbc load, exec("


            select 
				min(REDACTED) as min_date,
				REDACTED
			into #t1
			from REDACTED
			where REDACTED = 2019
			group by REDACTED;
			
			select
				count(*) as n
			from #t1
			where min_date >= 20220101
			
	") multistatement
	dsn("REDACTED") user($usr) password($pwd) sqlshow;
#delimit cr

list

cap log close
